home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 3
/
Info_Mac_1994-01.iso
/
Development
/
Source
/
Little C Source
/
Ex4.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-10-04
|
206b
|
17 lines
/* This program demonstrates recursive functions. */
main()
{
print(factr(7) * 2);
}
/* return the factorial of i */
factr(int i)
{
if(i<2) {
return 1;
}
else {
return i * factr(i-1);
}
}